function initKindEditor(filename,basePath){
	var editor;
	KindEditor.ready(function(K) {
		editor=K.create('textarea[name="content"]', {
			cssPath :basePath+ '/resources/kindeditor/plugins/code/prettify.css',
			uploadJson : basePath+'/editor/UploadImage?singleDieName='+filename,
			allowImageUpload : true, 
			formatUploadUrl:true,
			autoHeightMode : true,
			allowImageRemote:false,
			imageTabIndex:1,
			width:"100%",
			height:"280px",
			afterBlur:function(){//Kindeditor下获取文本框信息
				this.sync();
			},
	     	items : [
	      			'source', '|', 'undo', 'redo', '|', 'preview', 'print', 'template', 'code', 'cut', 'copy', 'paste',
	      			'plainpaste', 'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
	      			'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
	      			'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen',
	      			'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
	      			'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
	      			'flash', 'insertfile', 'table', 'hr', 'emoticons','pagebreak',
	      			'anchor', 'link', 'unlink', '|', 'about'
	      	 ]  
		});
	});
	return editor;
}
function initDatagrid(id,url,method,columns,dialogDiv){
	$('#'+id).datagrid({
	    url:url,
	    method:method,
	    autoSizeColumn:"true",
	    pagination:"true",
	    rownumbers:"true",
	    columns:columns,
	    toolbar: [{
			iconCls: 'icon-add',
			text:'新增',
			handler: function(){dialogDiv.dialog("open");}
		}]
	});
}
